package com.example.guli.service.base.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableTransactionManagement//mybatis-plus使用本地的事务
@Configuration//配置文件
//om.example.guli.service.base.config
//com.example.guli.service.edu
//com.example.guli.service.oss
//springboot一启动则会自动扫码主类所在的包以及子包下面所有的组件
@MapperScan("com.example.guli.service.*.mapper")//包扫码
public class MybatisPlusConfig {
    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}
